// Swap Anasayfa Manset Haberler
var secili_dhaberler = 1;
var dhaberler_sayisi = 8;
var dhaberler_degisme_suresi = 4000;
var dhaberlerTimeout = 1;
function dhaberler_goster() {
    for (i = 1; i <= dhaberler_sayisi; i++) {
        if (i == secili_dhaberler) {
            $("#dhbr_" + i).attr("class", "current");
        }
        else {
            $("#dhbr_" + i).attr("class", "");
        } //if
    } //for
} //function
function dhaberler_degistir(id) {
    if (id >= 1) {
        clearTimeout(dhaberlerTimeout);
        secili_dhaberler = id;
        dhaberler_goster();
    }
    else {
        dhaberler_goster();
        secili_dhaberler = secili_dhaberler + 1;
        if (secili_dhaberler > dhaberler_sayisi) secili_dhaberler = 1;

        dhaberlerTimeout = setTimeout("dhaberler_degistir(-1)", dhaberler_degisme_suresi);
    } //if
} //function
dhaberlerTimeout = setTimeout("dhaberler_degistir(-1)", dhaberler_degisme_suresi);

  $(function() {
    var galleries = $('.ad-gallery').adGallery();
    $('#switch-effect').change(
      function() {
        galleries[0].settings.effect = $(this).val();
        return false;
      }
    );
    $('#toggle-slideshow').click(
      function() {
        galleries[0].slideshow.toggle();
        return false;
      }
    );
    $('#toggle-description').click(
      function() {
        if(!galleries[0].settings.description_wrapper) {
          galleries[0].settings.description_wrapper = $('#descriptions');
        } else {
          galleries[0].settings.description_wrapper = false;
        }
        return false;
      }
    );
  });